package com.csweimei.rentmanagementtreasure.tenant.viewModel;

import android.app.Application;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.csweimei.rentmanagementtreasure.R;
import com.csweimei.rentmanagementtreasure.base.AppConfig;
import com.csweimei.rentmanagementtreasure.http.entity.CustomerDetailBean;
import com.csweimei.rentmanagementtreasure.tenant.ui.act.customer.AddCustomerActivity;
import com.csweimei.rentmanagementtreasure.tenant.ui.act.customer.CustomerDetailActivity;
import com.csweimei.rentmanagementtreasure.viewModel.TitleVM;

public class CustomerDVM extends TitleVM {
    public ObservableField<CustomerDetailBean.DataDTO> customerBean = new ObservableField<>();

    public CustomerDVM(@NonNull Application application) {
        super(application);
        setTitleText("详细资料");
        setRightIconVisible(View.VISIBLE);
        setRightImg(R.mipmap.iv_edit_fy);
    }

    @Override
    protected void rightIconOnClick() {
        super.rightIconOnClick();
        Bundle bundle = new Bundle();
        bundle.putString("id",customerBean.get().getId()+"");
        bundle.putString("flag","edit");
        startActivity(AddCustomerActivity.class,bundle);
        finish();
    }
}
